Skip to content

Conversation

@tusharshah21
Copy link
Collaborator

Summary

Adds twitter_handle field to user profiles with case-insensitive uniqueness enforcement and format validation, following the same pattern as github_login.

Closes #102

Changes

  • Add migration 005_add_twitter_handle.sql with column and unique index on LOWER(twitter_handle)
  • Add twitter_handle field to Profile entity, UpdateProfileRequest, and ProfileResponse DTOs
  • Add find_by_twitter_handle repository method with case-insensitive lookup
  • Validate Twitter handle format (1-15 alphanumeric characters + underscores)
  • Return 400 for invalid format, 409 for duplicate handle
  • Include twitter_handle in all GET profile responses
  • Update SQLx query cache files

API Changes

PUT /profile

{
  "twitter_handle": "tushar"  // optional, 1-15 chars: a-zA-Z0-9_
}

Copy link
Contributor

@joelamouche joelamouche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good!

Please add a test to profile_tests.rs and also a script like scripts/test_projects.sh to easily test this without a frontend

@@ -0,0 +1,122 @@
#!/usr/bin/env bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fetching nonce for 0x6cfD0753EC4da15Dcb418E11e921C0665c1d1cBf...
Nonce response: {"nonce":3,"address":"0x6cfD0753EC4da15Dcb418E11e921C0665c1d1cBf"}
Signing nonce...
Fetching current profile...
GET profile HTTP 404:
Updating profile with twitter_handle: testhandle...
PUT profile HTTP 404:
❌ Unexpected status 404

Maybe there is something wrong with the url?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add twitter/X handle to profiles in the backend

3 participants